package com.rabbit.config;

import com.rabbit.route.ExchangeName;
import com.rabbit.route.QueueName;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * @author yuhuan
 * @date 2025/4/21
 */
@Configuration
public class MqProducerProperties {

    @Value("${mq.queue.sync.user:}")
    private String syncUserQueueName;

    @Value("${mq.queue.sync.room:}")
    private String syncRoomQueueName;

    @Value("${mq.queue.sync.device:}")
    private String syncDeviceQueueName;

    @Value("${mq.exchange.sync:}")
    private String syncExchangeName;

    @Value("${mq.queue.notice.hotel:}")
    private String noticeHotelQueueName;

    @Value("${mq.queue.notice.admin:}")
    private String noticeAdminQueueName;

    @Value("${mq.exchange.notice:}")
    private String noticeExchangeName;

    @Value("${mq.exchange.topic:}")
    private String topicExchangeName;

    public String getNoticeHotelQueueName() {
        if (noticeHotelQueueName.equals("")) {
            noticeHotelQueueName = QueueName.MQ_NOTICE_HOTEL;
        }
        return noticeHotelQueueName;
    }

    public void setNoticeHotelQueueName(String noticeHotelQueueName) {
        this.noticeHotelQueueName = noticeHotelQueueName;
    }

    public String getNoticeAdminQueueName() {
        if (noticeAdminQueueName.equals("")) {
            noticeAdminQueueName = QueueName.MQ_NOTICE_ADMIN;
        }
        return noticeAdminQueueName;
    }

    public void setNoticeAdminQueueName(String noticeAdminQueueName) {
        this.noticeAdminQueueName = noticeAdminQueueName;
    }

    public String getNoticeExchangeName() {
        if (noticeExchangeName.equals("")) {
            noticeExchangeName = ExchangeName.MQ_NOTICE;
        }
        return noticeExchangeName;
    }

    public String getTopicExchangeName() {
        if (topicExchangeName.equals("")) {
            topicExchangeName = ExchangeName.MQ_TOPIC;
        }
        return topicExchangeName;
    }

    public void setTopicExchangeName(String topicExchangeName) {
        this.topicExchangeName = topicExchangeName;
    }

    public void setNoticeExchangeName(String noticeExchangeName) {
        this.noticeExchangeName = noticeExchangeName;
    }

    public String getSyncUserQueueName() {
        if (syncUserQueueName.equals("")) {
            syncUserQueueName = QueueName.MQ_SYNC_USER;
        }
        return syncUserQueueName;
    }

    public void setSyncUserQueueName(String syncUserQueueName) {
        this.syncUserQueueName = syncUserQueueName;
    }

    public String getSyncRoomQueueName() {
        if (syncRoomQueueName.equals("")) {
            syncRoomQueueName = QueueName.MQ_SYNC_ROOM;
        }
        return syncRoomQueueName;
    }

    public void setSyncRoomQueueName(String syncRoomQueueName) {
        this.syncRoomQueueName = syncRoomQueueName;
    }

    public String getSyncDeviceQueueName() {
        if (syncDeviceQueueName.equals("")) {
            syncDeviceQueueName = QueueName.MQ_SYNC_DEVICE;
        }
        return syncDeviceQueueName;
    }

    public void setSyncDeviceQueueName(String syncDeviceQueueName) {
        this.syncDeviceQueueName = syncDeviceQueueName;
    }

    public String getSyncExchangeName() {
        if (syncExchangeName.equals("")) {
            syncExchangeName = ExchangeName.MQ_SYNC;
        }
        return syncExchangeName;
    }

    public void setSyncExchangeName(String syncExchangeName) {
        this.syncExchangeName = syncExchangeName;
    }
}
